<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>AngularJs</title>
		<link href="css/bootstrap.min.css" rel="stylesheet">
		<script src="js/angular.min.js"></script>
	</head>
	<body>
		<div ng-app="myApp" ng-init="names=['Jane','tome','timy'];emailadd='shuangzh@qq.com'">
			<p>name : <input type="text" ng-model="name">
				<h1>hell {{name}}</h1>
				
			</p>
			
			<p>
				<div ng-controller="myclt">
				<h2>price calculate</h2>
				
				quantity : <input type="number"	ng-model="quantity" />
				price : <input type="number" ng-model="price" />
				total:{{quantity * price}}
				local:<input type="text"	ng-model="localurl" />
				
				</div>
				
			</p>
			<p>
				<ul>
					<li ng-repeat="x in names">
						{{ x }}
					</li>
				</ul>
				
			</p>
			
			<p>
				<form name="myform">
					email:
					<input type="email"  name="address" ng-model="emailadd"/>
					<span ng-show="myform.address.$error.email"> 这不是一个合法的地址</span>
					
				</form>
			</p>
			
		</div>
		
		<script>
			var app=angular.module('myApp', []);
			app.controller('myclt',function($scope, $location)
			{
				$scope.quantity=10;
				$scope.price=10;
				$scope.localurl=$location.absUrl();
			});
					
					
		</script>
		
		
	</body>
</html>
